# TTATGTTTTAAGGATGGGGCGTTAGTT
a = input()
pause_point = 0
try:
    try:
        a.index('ATG', pause_point)
    except:
        print('no gene is found')
    while pause_point + 1 <= len(a):

        start = a.index('ATG', pause_point)

        try:
            end1 = a.index('TAG', pause_point + 3)
        except:
            end1 = 9999999
        finally:
            pass

        try:
            end2 = a.index('TAA', pause_point + 3)
        except:
            end2 = 9999999
        finally:
            pass

        try:
            end3 = a.index('TGA', pause_point + 3)
        except:
            end3 = 9999999
        finally:
            pass

        end = min(end1, end2, end3)
        # print(start, end)
        for i in range(start + 3, end, 3):
            codon = a[i] + a[i + 1] + a[i + 2]
            print(codon, end='')

        pause_point = end
        print('')
except:
    pass
finally:
    pass
